package com.wl.controller;

import com.wl.domain.AjaxResult;
import com.wl.dto.ProductDto;
import com.wl.feign.FeignServer;
import com.wl.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/product")
@RestController
public class ProductController {
    @Autowired
    private ProductService productService;
    /**
     * 新增
     * @param productDto
     * @return
     */
    @PostMapping
    private AjaxResult save(@RequestBody ProductDto productDto){
        try {
            AjaxResult ajaxResult = productService.steProduct(productDto);
            return ajaxResult;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return new AjaxResult(false,"失败");
    }
}
